const express = require('express');
const apiRouter = require('./routes/apiRouter');
const session = require('express-session');
const app = express();
app.listen(80,()=>{
    console.log("80端口启动成功");
})
app.use((req,res,next)=>{
    res.setHeader('Access-Control-Allow-Origin','*');
    next();
})
app.use(session({
    name:"sid",
    secret:"XA0315",
    saveUninitialized:true,
    resave:true,
    cookie:{
        httpOnly:true,
        maxAge:1000*60*60
    }
}))
app.use(express.static(__dirname+'/public'))
app.use(express.urlencoded({extended:true}));

app.use(apiRouter);

